<template>
  <div class="child2">
    <h2>我是Child2组件</h2>
    <h3>我想对你说：{{str}}</h3>
    <button @click="getText">点我获取一句土味情话</button>
  </div>
</template>

<script>
  import randomText from '../mixins/randomText'

  export default {
    name:'Child2',
    data() {
      return {
        str:999
      }
    },
    mixins:[randomText],
    mounted() {
      console.log('Child2---mounted')
    },
  }
</script>

<style scoped>
  .child2 {
    background-color: orange;
    padding: 20px;
  }
</style>